package com.imu.purse.modules.sys.dao;

import java.util.List;
import org.apache.ibatis.annotations.Select;

import com.imu.core.base.BaseMapper;
import com.imu.purse.modules.sys.entity.SysCarouselEntity;

/**
 * 轮播图配置表
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2017-11-06 17:17:24
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
public interface SysCarouselMapper extends BaseMapper<SysCarouselEntity>
{
	/**
     * 分页查询
     * @param pageNo 页号
     * @param pageSize 每页显示记录数
     * @return
     */
	@Select({
		"<script>",
		    "SELECT car_id,",
					"type,",
					"url,",
					"remark,",
					"ahref,",
					"sort,",
					"status,",
					"user_create,",
					"time_create,",
					"user_update,",
					"time_update",
		    "FROM sys_carousel ",
		    "WHERE status != -1",
			"<when test = 'type != null'>",
		    	"AND `type` = #{type}",
		    "</when>",
		    "<when test = 'sts != null'>",
		    	"AND time_create &gt;= #{sts}",
		    "</when>",
		    "<when test = 'ets != null'>",
				"AND time_create &lt;= #{ets}",
			"</when>",
		    "ORDER BY time_create DESC",
    	"</script>"
	})
    public List<SysCarouselEntity> findByPage(final SysCarouselEntity entity);	
}
